package com.rjxy.plansystemmanagement.mapper;

import com.rjxy.plansystemmanagement.entity.HotelInformation;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface HotelMapper {
    @Select("select * from HotelInformation")
    List<HotelInformation> list();

    @Delete("delete from HotelInformation where ID = #{ID}")
    void deleteHotel(Integer id);

    @Insert("insert into hotelInformation(HotelName,HotelStar,HotelAddress,HotelTheme,HotelFacilities)" +
    "VALUES (#{HotelName},#{HotelStar},#{HotelAddress},#{HotelTheme},#{HotelFacilities})")
    void addHotel(HotelInformation hotelInformation);


    @Select("select * from HotelInformation where ID = #{ID}")
    HotelInformation getHotelById(Integer hotelID);

    @Select("select * from HotelInformation where HotelAddress = #{HotelAddress}")
    List<HotelInformation> getHotelByAddress(@Param("HotelAddress") String hotelAddress);

    @Select("select * from HotelInformation where HotelStar = #{HotelStar}")
    List<HotelInformation> getHotelByStar(@Param("HotelStar") String hotelStar);

    @Select("select * from HotelInformation where HotelName = #{HotelName}")
    HotelInformation getHotelByName(@Param("HotelName") String hotelName);


    void updateHotel(HotelInformation hotelInformation);

    @Select("select * from HotelInformation where hotelTheme = #{hotelTheme}")
    List<HotelInformation> getHotelByTheme(String hotelTheme);

    @Select("select * from HotelInformation where hotelFacilities = #{hotelFacilities}")
    List<HotelInformation> getHotelByFacilities(String hotelFacilities);

    List<HotelInformation> searchHotels(String hotelAddress, String hotelStar, String hotelTheme, String hotelFacilities);
}
